Skip to content

Cf 3137 : List and describe Flink Application instances#3307

Open
Paras Negi (paras-negi-flink) wants to merge 3 commits into
mainfrom
CF-3137
Open

Cf 3137 : List and describe Flink Application instances#3307
Paras Negi (paras-negi-flink) wants to merge 3 commits into
mainfrom
CF-3137

Conversation

@paras-negi-flink
Copy link
Copy Markdown
Contributor

@paras-negi-flink Paras Negi (paras-negi-flink) commented Apr 6, 2026

Release Notes

Breaking Changes

  • None

New Features

  • Added confluent flink application instance [list | describe] commands to manage Flink application instances in Confluent Platform.

Bug Fixes

  • None

Checklist

  • I have successfully built and used a custom CLI binary, without linter issues from this PR.
  • I have clearly specified in the What section below whether this PR applies to Confluent Cloud, Confluent Platform, or both.
  • I have attached manual CLI verification results or screenshots in the Test & Review section below.
  • I have added appropriate CLI integration or unit tests for any new or updated commands and functionality.
  • I confirm that this PR introduces no breaking changes or backward compatibility issues.
  • I have indicated the potential customer impact if something goes wrong in the Blast Radius section below.
  • I have put checkmarks below confirming that the feature associated with this PR is enabled in:
    • Confluent Cloud prod
    • Confluent Cloud stag
    • Confluent Platform
    • Check this box if the feature is enabled for certain organizations only

What

This PR implements CF-3137 — List and describe Flink Application instances for the Confluent CLI, targeting Confluent Platform / CP Flink (CMF on-prem):

  • Adds new commands under confluent flink application:
    • confluent flink application instance list --environment <env> --application <app>
    • confluent flink application instance describe <name> --environment <env> --application <app>
  • Wires these commands to the CMF FlinkApplicationInstance REST APIs:
    • GET /cmf/api/v1/environments/{envName}/applications/{appName}/instances
    • GET /cmf/api/v1/environments/{envName}/applications/{appName}/instances/{instanceName}
  • Adds CmfRestClient wrappers (ListApplicationInstances, DescribeApplicationInstance) and corresponding local types/output formatting, following existing patterns used for catalogs, databases, and compute pools.

Blast Radius

  • Scope is limited to new Flink application instance commands; existing CLI behavior is unchanged.
  • If something goes wrong:
    • Impact is confined to users listing/describing Flink application instances via the new commands.
    • Listing/describe may not show correct state for instances; CMF remains the source of truth.
  • There are no breaking changes to existing commands, flags, or APIs. Reverting is straightforward (command group + client wrapper).

References

Test & Review

Environment

  • Repo: confluentinc/cli
  • Branch: CF-3137
  • CMF: 2.3-SNAPSHOT
  • Kubernetes: local cluster with CMF deployed (cmf-service exposed via kubectl port-forward svc/cmf-service 8080:80 -n e2e)

Manual CLI validation

  1. List Application Instances
parasnegi@C6V9RN9V2Y % ./confluent flink application instance list --url http://localhost:8080 --environment test --application test-application
                  Name                 |      Creation Time       |              Job ID              | Job State
---------------------------------------+--------------------------+----------------------------------+------------
  5c08c95f-9ea1-4798-aa69-f0e1ce5ca377 | 2026-04-07T05:14:15.982Z | 8ce284f5488785da3d9c2fbdd7a59feb | FINISHED
  71509bd4-406f-4170-9769-69deb24b4633 | 2026-04-07T05:15:32.091Z | 3c5d692e3f3b4a64e8163f53e53eaa7b | FINISHED
  aa96ecac-e748-4c21-8eeb-de08ccb74220 | 2026-04-07T05:15:47.079Z | e406b40fe97d1d6dc9af81cf9d33b47d | RUNNING
  1. Describe Application Instance
parasnegi@C6V9RN9V2Y % ./confluent flink application instance describe aa96ecac-e748-4c21-8eeb-de08ccb74220 --url http://localhost:8080 --environment test --application test-application
{
  "apiVersion": "cmf.confluent.io/v1",
  "kind": "FlinkApplicationInstance",
  "metadata": {
    "name": "aa96ecac-e748-4c21-8eeb-de08ccb74220",
    "uid": "aa96ecac-e748-4c21-8eeb-de08ccb74220",
    "creationTimestamp": "2026-04-07T05:15:47.079Z",
    "updateTimestamp": "2026-04-07T05:15:47.079Z",
    "labels": {},
    "annotations": {}
  },
  "status": {
    "spec": {
      "flinkConfiguration": {
        "taskmanager.numberOfTaskSlots": "2"
      },
      "flinkVersion": "v1_19",
      "image": "confluentinc/cp-flink:1.19.1-cp1",
      "job": {
        "jarURI": "local:///opt/flink/examples/streaming/StateMachineExample.jar",
        "parallelism": 1,
        "state": "running",
        "upgradeMode": "stateless"
      },
      "serviceAccount": "flink"
    },
    "jobStatus": {
      "jobId": "e406b40fe97d1d6dc9af81cf9d33b47d",
      "state": "RUNNING"
    }
  }
}

Copilot AI review requested due to automatic review settings April 6, 2026 05:39
@confluent-cla-assistant
Copy link
Copy Markdown

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Confluent Platform (CMF/on-prem) CLI support for working with Flink Application Instances, and extends the CMF catalog surface with an update operation, including corresponding test-server routes and golden-based integration coverage.

Changes:

  • Add confluent flink application instance [list|describe] commands backed by new CMF REST client methods.
  • Add confluent flink catalog update <resourceFilePath> command (JSON/YAML) and CMF REST client support for updating catalogs.
  • Extend on-prem test server handlers/routes and add integration tests + golden fixtures for the new commands.

Reviewed changes

Copilot reviewed 42 out of 42 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/flink/cmf_rest_client.go Adds CMF client methods for catalog update + application instance list/describe.
internal/flink/command_application.go Wires new application instance subcommand into the Flink application command tree.
internal/flink/command_application_instance*.go Implements instance list/describe commands and SDK→local conversion for serialized output.
internal/flink/local_types.go Adds local (serialized) types for Flink application instances.
internal/flink/command_catalog.go Adds shared helpers for catalog output and resource file parsing; registers catalog update subcommand.
internal/flink/command_catalog_update.go Implements flink catalog update using a resource file and follow-up describe.
test/test-server/flink_onprem_router.go Adds CMF routes for application instance list/describe.
test/test-server/flink_onprem_handler.go Implements handlers for instance list/describe and adds catalog PUT support in the test server.
test/flink_onprem_test.go Adds integration test cases for instance list/describe and catalog update.
test/fixtures/input/flink/catalog/update-*.{json,yaml} Adds catalog update request payloads for tests.
test/fixtures/output/flink/application/** Adds help + output fixtures for the new instance commands.
test/fixtures/output/flink/catalog/** Adds help + output fixtures for the new catalog update command.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/flink_onprem_test.go Outdated
Comment on lines +448 to +459
func (s *CLITestSuite) TestFlinkCatalogUpdateOnPrem() {
tests := []CLITest{
// success
{args: "flink catalog update test/fixtures/input/flink/catalog/update-successful.json", fixture: "flink/catalog/update-success.golden"},
{args: "flink catalog update test/fixtures/input/flink/catalog/update-successful.json --output json", fixture: "flink/catalog/update-success-json.golden"},
{args: "flink catalog update test/fixtures/input/flink/catalog/update-successful.json --output yaml", fixture: "flink/catalog/update-success-yaml.golden"},
// failure
{args: "flink catalog update test/fixtures/input/flink/catalog/update-invalid-failure.json", fixture: "flink/catalog/update-invalid-failure.golden", exitCode: 1},
}

runIntegrationTestsWithMultipleAuth(s, tests)
}
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestFlinkCatalogUpdateOnPrem duplicates the JSON update cases that are already covered in TestFlinkCatalogUpdateWithYAML (which currently tests both JSON and YAML resource files). This makes the suite do redundant work and increases fixture coupling. Consider keeping a single catalog-update test and either (a) move all JSON cases into the OnPrem test and make the WithYAML test YAML-only, or (b) drop the OnPrem test and keep the combined JSON+YAML coverage in one place.

Copilot uses AI. Check for mistakes.
Comment on lines +11 to +18
func (c *command) newCatalogUpdateCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "update <resourceFilePath>",
Short: "Update a Flink catalog.",
Long: "Update an existing Kafka Catalog in Confluent Platform from a resource file.",
Args: cobra.ExactArgs(1),
RunE: c.catalogUpdate,
}
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR introduces the flink catalog update command in addition to Flink application instance list/describe. The PR title/description currently only references application instances and has placeholder release notes, so it’s unclear whether the catalog update command is in-scope and should be documented/released together. Please update the PR description/release notes (or split into a separate PR) so reviewers and release tooling can track the catalog update feature correctly.

Copilot uses AI. Check for mistakes.
@sonarqube-confluent
Copy link
Copy Markdown

@paras-negi-flink Paras Negi (paras-negi-flink) marked this pull request as ready for review May 13, 2026 18:13
@paras-negi-flink Paras Negi (paras-negi-flink) requested a review from a team as a code owner May 13, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants